-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for RGBW lights #2
base: main
Are you sure you want to change the base?
Conversation
let movie = makeMovie({ | ||
nLeds, | ||
nFrames: nLeds + 20, | ||
tailLength: 20, | ||
type: details.led_profile?.toLowerCase() || 'rgb', | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Made this function configurable so it'll match the device's specs
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh also nFrames = nLeds + tailLength
lets the tail fade out rather than cutting it off
if (white && preserveWhite) { | ||
this.brighten(white / 255); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tbf this is probably unnecessary
return new Uint8Array( | ||
this._type === 'rgbw' | ||
? [this.white!, this.red, this.green, this.blue] | ||
: [this.red, this.green, this.blue] | ||
); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Apparently RGBW products use white as the first byte 🤷
import { Led } from "./led"; | ||
import { Frame } from "./frame"; | ||
import { Movie } from "./movie"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removing the .js
extension throughout fixed some module resolution quirks in VSCode for me
Hey, just wanted to mention here that I made an RGBW implementation as well here: matthi4s@a886a16 I tried to avoid having to declare every LED as RGBW, so any LED, Frame or Movie can be used on RGB and RGBW devices without any further changes, you just have to declare RGBW on the device level (or even autodetect it). Not sure really which one is the better solution. I can also create a PR for it, but #1 should be merged first. |
Hey! Hope you don't mind but your fork seems to be the most updated of the bunch, but it lacked support for RGB+W Twinkly products.
tl;dr changelog:
I'll annotate the diff in a bit!